<%@ page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<jsp:include page="/_include2/_css.jsp" />
</head>




<script>
        $().ready(function() {
            $("#userInfoForm").validate({
                rules: {
                	storehouse_name: {
                        required: true,
                        minlength: 2
                    },
                    total_content: {
                        required: true,
                        digits:true
                    },
                    residual_content: {
                        required: true,
                        digits:true
                    },
                    create_date: {
                        required: true,
                        date: true
                    },
                    responsible_person:{
                    	required: true,
                    }
                },
                messages: {
                	storehouse_name: {
                        required: "请输入仓库名",
                        minlength: "仓库名必需由两个字母组成"
                    },
                    total_content: {
                        required: "请输入总容量",
                        digits: "必须输入整数"
                    },
                    residual_content: {
                        required: "请输入剩余容量",
                        digits: "必须输入整数"
                    },
                    create_date: "请输入一个正确的日期"
                }
            });
        });
    </script>
    <style>
        .error{
            color:red;
        }
    </style>
<body>

	<jsp:include page="/_include2/_menu.jsp">
		<jsp:param value="仓库管理" name="one"/>
		<jsp:param value="仓库添加" name="two"/>
	</jsp:include>
	<div class="col-md-12">
		<form action="${pageContext.request.contextPath}/StoreServlet/add" id="userInfoForm" mothed="post">
			<div class="form-group">
				<div>
					<p  >
					<label for="storehouse_name"> 仓库名称</label></p> 
				</div>
				<input type="text" class="form-control" name="storehouse_name" id="storehouse_name">
				<div id="nameMsg"></div>
			</div>
			
			
			<div class="form-group">
				<label for="create_date">创建时间：</label> 
				<input type="text" name="create_date" class="form-control" id="create_date"/>
			</div>
			
			<div class="form-group">
				<div>
					<p  >
					<label for="total_content">总容量</label></p> 
				</div>
				<input type="text" class="form-control" name="total_content" id="total_content">
				<div id="total_contentMsg"></div>
			</div>
			<div class="form-group">
				<div>
					<p  >剩余容量</p> 
				</div>
				<input type="text" class="form-control" name="residual_content" id="residual_content">
				<div id="residual_contentMsg"></div>
			</div>
			
			<div class="form-group">
				<div>
					<p  >备注</p> 
				</div>
				<input type="text" class="form-control" name="remark" id="remark">
				<div id="remarkMsg"></div>
			</div>
			<div class="form-group">
				<div>
					<p  >
					<label for="responsible_person">仓库负责人</label></p> 
				</div>
				<input type="text" class="form-control" name="responsible_person" id="responsible_person">
				<div id="responsible_personMsg"></div>
			</div>
			<input type="submit" class="btn btn-default" value="添加"/>
		</form>
	</div>
</body>

<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/js2/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/js2/jquery.validate.js"></script>
    <script src="${pageContext.request.contextPath}/js2/messages_zh.js"></script>

</html>